package com.ruoyi.yqhs.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.yqhs.mapper.YqhsSjdcMapper;
import com.ruoyi.yqhs.domain.YqhsSjdc;
import com.ruoyi.yqhs.service.IYqhsSjdcService;

/**
 * 数据断传Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-31
 */
@Service
public class YqhsSjdcServiceImpl implements IYqhsSjdcService 
{
    @Autowired
    private YqhsSjdcMapper yqhsSjdcMapper;

    /**
     * 查询数据断传
     * 
     * @param id 数据断传主键
     * @return 数据断传
     */
    @Override
    public YqhsSjdc selectYqhsSjdcById(Long id)
    {
        return yqhsSjdcMapper.selectYqhsSjdcById(id);
    }

    /**
     * 查询数据断传列表
     * 
     * @param yqhsSjdc 数据断传
     * @return 数据断传
     */
    @Override
    public List<YqhsSjdc> selectYqhsSjdcList(YqhsSjdc yqhsSjdc)
    {
        return yqhsSjdcMapper.selectYqhsSjdcList(yqhsSjdc);
    }

    /**
     * 新增数据断传
     * 
     * @param yqhsSjdc 数据断传
     * @return 结果
     */
    @Override
    public int insertYqhsSjdc(YqhsSjdc yqhsSjdc)
    {
        yqhsSjdc.setId(IdUtils.getId());
        yqhsSjdc.setCreateBy(SecurityUtils.getLoginUser().getUsername());
        yqhsSjdc.setCreateTime(DateUtils.getNowDate());
        return yqhsSjdcMapper.insertYqhsSjdc(yqhsSjdc);
    }

    /**
     * 修改数据断传
     * 
     * @param yqhsSjdc 数据断传
     * @return 结果
     */
    @Override
    public int updateYqhsSjdc(YqhsSjdc yqhsSjdc)
    {
        yqhsSjdc.setUpdateBy(SecurityUtils.getLoginUser().getUsername());
        yqhsSjdc.setUpdateTime(DateUtils.getNowDate());
        return yqhsSjdcMapper.updateYqhsSjdc(yqhsSjdc);
    }

    /**
     * 批量删除数据断传
     * 
     * @param ids 需要删除的数据断传主键
     * @return 结果
     */
    @Override
    public int deleteYqhsSjdcByIds(Long[] ids)
    {
        return yqhsSjdcMapper.deleteYqhsSjdcByIds(ids);
    }

    /**
     * 删除数据断传信息
     * 
     * @param id 数据断传主键
     * @return 结果
     */
    @Override
    public int deleteYqhsSjdcById(Long id)
    {
        return yqhsSjdcMapper.deleteYqhsSjdcById(id);
    }
}
